package bai9.view;

import java.util.Scanner;

import bai9.model.Employee;
import bai9.service.EmployeeAPI;
import bai9.service.implement.Constan;
import bai9.service.implement.EmployeeDAO;

public class Run {
	public static void main(String args[]){
		EmployeeAPI dao=new EmployeeDAO();
		Employee emp=new Employee();
		Scanner ip=new Scanner(System.in);
		int choise=1;
		do{
			System.out.println("1.Thong tin Employee");
			System.out.println("2.Thong tin Project");
			System.out.println("3.Thong tin Profile");
			System.out.println("Chon chuc nang");
			try{
				int chon=Integer.parseInt(ip.nextLine());

				switch(chon){
				case 1:if(dao.addEmployee(emp.inputEmployee())==Constan.SER_STATUS_SUCSESS)
					
				System.out.println("Add Successfull");
					
				break;
				case 2:
					dao.display();
					break;
				case 3:
					dao.updateEmployee(emp);
					break;
				case 4:
					break;
				default: System.out.println("Nhap tu 1-4");
				}
			}catch(NumberFormatException e){
				System.out.println("Chua nhap hoac nhap sai dinh dang");
			}
		}while(choise==1);
	}
}
